<template>
  <div class="flex p-3">
    <recordTree
      @update:selected-value="handleSelectedValueUpdate"
      @update:node-id="handleNodeIdUpdate"
    />
    <recordTable :selected-node-id="selectedNodeId" />
  </div>
</template>
<script lang="ts" setup>
import recordTree from './components/recordTree.vue';
import recordTable from './components/recordTable.vue';
import { ref } from 'vue';
// 定义一个 ref 来存储从 customerTree 接收到的值
const selectedValue = ref('');
// 定义一个 ref 来存储选中节点的ID
const selectedNodeId = ref<null | string>(null);

// 定义处理 customerTree 事件的方法
const handleSelectedValueUpdate = (value: string) => {
  selectedValue.value = value;
};

// 定义处理节点选择的方法
const handleNodeIdUpdate = (id: string) => {
  selectedNodeId.value = id;
};
</script>
<style scoped></style>
